/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.model.disc.pointforce;

import br.ufmg.dees.insane.util.IPoint3d;
import br.ufmg.dees.insane.util.IVector;


/**
*A class representing a concentrated force.
*
*@author Fonseca, Flavio & Pitangueira, Roque
*@version 1.0
*@since September 2003
*@see PointForce
*/

public class PointForce implements java.io.Serializable
{
	private static final long serialVersionUID = 1L;

	/** The label of this PointForce. */
	protected String label;
	
	/** The coord of the application point of this PointForce. */
	protected IPoint3d coord = new IPoint3d();
	
	/** The six possible forces of this PointForce.<br>
	*They are stored in this order: <i>Fx, Fy, Fz, Mx, My, Mz</i>*/
	protected IVector force = new IVector(6);
	
//********************************************************************************
	
	/** Returns the label of this PointForce.
	*@return The label of this PointForce.
	*/
	public String getLabel()
	{
		return (label);
	}
	
	/** Sets the label of this PointForce.
	*@param a The label of this PointForce.
	*/
	public void setLabel(String a)
	{
		label = a;
	}
	
//********************************************************************************
	
	/** Returns the force of this PointForce at the specified position.
	*@param a The position of the force.
	*@return The force at the specified position.
	*/
	public double getForce(int a)
	{
		return (force.getElement(a));
	}
	
	/** Return the force of this PointForce.
	*@return The IVector with the all forces of this PointForce.
	*/
	public IVector getForces()
	{
		return force;
	}
	
	/** Sets the force of this PointForce at the specified position.
	*@param a The position of the force.
	*@param b The force at the specified position.
	*/
	public void setForce(int a, double b)
	{
		force.setElement(a, b);
	}
	
	/** Set the force of this PointForce.
	*@param a The IVector with all possible forces of this PointForce.
	*/
	public void setForce(IVector a)
	{
		force = a;
	}
	
	/** Set the value of force to the sum of itself and a.
	*@param a The IVector that will be added.
	*/
	public void addForce(IVector a)
	{
		force.add(a);
	}
	
//********************************************************************************
	
	/** Returns the application point of this PointForce.
	*@return The application point of this PointForce.
	*/
	public IPoint3d getCoord()
	{
		return (coord);
	}
	
	/** Sets the application point of this PointForce.
	*@param a The application point of this PointForce.
	*/
	public void setCoord(IPoint3d a)
	{
		coord = a;
	}
	
	/** Sets the application point of this PointForce.
	*@param x The coord X of the application point of this PointForce.
	*@param y The coord Y of the application point of this PointForce.
	*@param z The coord Z of the application point of this PointForce.
	*/
	public void setCoord(double x, double y, double z)
	{
		IPoint3d aux = new IPoint3d(x, y, z);
		coord = aux;
	}
	
//********************************************************************************

}
